package com.xjggb.cloud.controller;

import com.xjggb.cloud.entity.CommonResult;
import com.xjggb.cloud.service.PaymentFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {

    @Autowired
    private PaymentFeignService paymentFeignService;

    @GetMapping("/feign/{id}")
    public CommonResult show(@PathVariable("id") Long id){
        CommonResult commonResult = paymentFeignService.agePaymentById(id);

        return commonResult;
    }


    //模拟超时
    @GetMapping("/payment/feign/timeout")
    public int timeout(){

        return paymentFeignService.timeout();
    }



}
